<?php
class ORMProducePurchaseItem extends ORMBase {
  public function __construct() {
    parent::__construct('ProducePurchaseItem');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->produce_trackId = isset($object->produce_trackId) ? $object->produce_trackId : '';
    $epObject->sampleId = isset($object->sampleId) ? $object->sampleId : 0;
    $epObject->name = isset($object->name) ? $object->name : '';
    $epObject->price = isset($object->price) ? $object->price : 0;
    $epObject->unit = isset($object->unit) ? $object->unit : '';
    $epObject->type = isset($object->type) ? $object->type : '';
    $epObject->model = isset($object->model) ? $object->model : '';
    $epObject->otherId = isset($object->otherId) ? $object->otherId : '';
    $epObject->quantity = isset($object->quantity) ? $object->quantity : 0;
    $epObject->total = isset($object->total) ? $object->total : 0;
    $epObject->packageInc = isset($object->packageInc) ? $object->packageInc : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->produce_trackId = $epObject->produce_trackId;
    $object->sampleId = $epObject->sampleId;
    $object->name = $epObject->name;
    $object->price = $epObject->price;
    $object->unit = $epObject->unit;
    $object->type = $epObject->type;
    $object->model = $epObject->model;
    $object->otherId = $epObject->otherId;
    $object->quantity = $epObject->quantity;
    $object->total = $epObject->total;
    $object->packageInc = $epObject->packageInc;
    return $object;
  }
}
?>
